package com.lightning.modules.utils;

import java.util.Date;
import java.util.UUID;

import org.apache.commons.lang.time.DateFormatUtils;

/**
 * Generate random UUID - a 32-bit hex string.
 * 
 * @author Michael Liao (askxuefeng@gmail.com)
 */
public abstract class RandomUtils {

    private RandomUtils() {}

    public static String nextId() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    public synchronized static String timeId() {
    	return DateFormatUtils.format(new Date(), "yyyyMMdd-HHmmss-S");
    }
    public static void main(String[] args) {
		System.out.println(timeId());
	}
}
